<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <g:set var="entityName" value="${message(code: 'contact.label', default: 'Contact')}" />
    <title>逾期/违约(个人)审批详情</title>
    <style>
    .contact-stat{
        padding: 8px 0px;
        text-align: center;
    }
    .contact-stat span{
        font-size: 13px;
        color: #88898c;
        margin-bottom: 10px;
    }
    .contact-stat strong{
        font-size: 13px;
        word-wrap: break-word;
    }
    .nav-tabs{
        border-bottom: none;
    }
    .hpanel > .panel-footer, .hpanel > .panel-section{
        background: #f9f9f9;
    }
    .flex{
        display: flex;justify-content: center;align-items: center;
    }
    .newFontSize{
        font-size: 12px;
    }
    table>tbody>tr>td, table>tbody>tr>th,.table>tfoot>tr>td, table>tfoot>tr>th, table>thead>tr>td, table>thead>tr>th{
        padding: 8px;
        line-height: 1.42857143;
        white-space: nowrap;
    }
    .red{
        color: #e74c3c;
    }
    </style>
</head>
<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>
                        <span>CINDTATA PLS</span>
                    </li>
                    <li>
                        <g:link action="index">
                            <span>逾期/违约(个人)</span>
                        </g:link>
                    </li>
                    <li class="active">
                        <span>逾期/违约(个人)详情</span>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>

<g:if test="${params?.message}">
    <div class="message alert alert-info" role="status">${params?.message}</div>
</g:if>

<g:if test="${flash.message}">
    <div class="message alert alert-info" role="status">${flash.message}</div>
</g:if>

<div class="content animate-panel">
    %{--押品信息--}%
    <div class="row">
        <div class="hpanel hgreen" style="">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                主要信息
            </div>

            <div class="panel-body">
                <div class="col-md-12 text-center">
                    <g:if test="${riskWarning?.stage?.code == '80'}">
                        <div class="col-md-3" style="width: 20%">
                            <h3 class="font-extra-bold m-b-xs">
                                <small style="font-size: 16px;">预警处置 : </small>
                                <span class="unitPrice" style="color: #62CB31">违约</span>
                            </h3>
                            <p><small style="color: #62CB31">大于5次</small></p>
                        </div>
                    </g:if>
                    <g:else>
                        <div class="col-md-3" style="width: 31%;">
                            <h3 class="font-extra-bold m-b-xs text-center">
                                <small style="font-size: 26px;">违约 :</small>
                                <span class="totalPrice" style="font-size: 26px;color: #62CB31">5</span>
                                <small class="newFontSize" style="font-size: 26px;color: #62CB31">次</small>
                            </h3>
                        </div>
                    </g:else>
                    <div class="col-md-3" style="width: 23%;">
                        <h3 class="font-extra-bold m-b-xs text-center">
                            <small style="font-size: 16px;">信用等级 :</small>
                            <span class="totalPrice">${contact?.creditLevel?contact?.creditLevel:'-'}</span>
                            <small class="newFontSize"></small>
                        </h3>
                    </div>
                    <div class="col-md-3" style="width: 23%;">
                        <h3 class="font-extra-bold m-b-xs text-center">
                            <small style="font-size: 16px;">信用额度 :</small>
                            <span class="totalPrice">${contact?.creditAmount?contact?.creditAmount/10000:'-'}</span>
                            <small class="newFontSize">万元</small>
                        </h3>
                    </div>
                    <div class="col-md-3" style="width: 23%;">
                        <span class="label label-success pull-right">
                            阶段：${this?.riskWarning?.stage?.name}
                        </span>

                        <h3 class="font-extra-bold m-b-xs text-center">
                            <small style="font-size: 16px;">信用余额 :</small>
                            <span class="totalPrice">${contact?.creditBalance?contact?.creditBalance/10000:'-'}</span>
                            <small class="newFontSize">万元</small>
                        </h3>
                    </div>
                </div>
            </div>

            <div class="panel-footer contact-footer">
                <div class="row">
                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>证件类型</span>
                            <strong>${contact?.identityType?.name ? contact?.identityType?.name : '-'}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>证件号码</span>
                            <strong class="certificateFormat">${contact?.idNumber ? contact?.idNumber : '-'}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>家庭住址</span>
                            <strong>${contact?.address}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>户口所在地</span>
                            <strong>${contact?.householdAddress}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>户口性质</span>
                            <strong>${contact?.householdType}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>工作单位</span>
                            <strong>${contact?.workUnitName}</strong>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    %{--预警信息--}%
    <div class="row">
        <div class="hpanel hgreen" style="">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                预警信息
            </div>
            <div class="panel-body no-padding" style="overflow-x:auto;">
                <table class="table table-striped table-bordered table-hover text-center">
                    <thead>
                    <tr>
                        <th>预警类型</th>
                        <th>工作流</th>
                        <th>当前阶段</th>
                        <th>催收部门</th>
                        <th>处置人员</th>
                        <th>催收说明</th>
                        <g:if test="${this?.riskWarning?.stage?.code == '94'}">
                            <th>还款截止日期</th>
                        </g:if>
                        <th>计划处置开始时间</th>
                        <th>计划处置结束时间</th>
                        <th>实际处置开始时间</th>
                        <th>实际处置结束时间</th>
                        <g:if test="${editRoleFlag && this?.riskWarning?.stage?.code == '94'}">
                         <th>操作</th>
                        </g:if>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>${this?.riskWarning?.type?.name}</td>
                        <td>${this?.riskWarning?.workflow?.name}</td>
                        <td>${this?.riskWarning?.stage?.name}</td>
                        <td>${this?.riskWarning?.disposalDepartment?.name}</td>
                        <td>${this?.riskWarning?.disposalUser?.fullName}</td>
                        <td>${this?.riskWarning?.description}</td>
                        <g:if test="${this?.riskWarning?.stage?.code == '94'}">
                            <g:formatDate date="${this.riskWarning?.repaymentEndDate}" format="yyyy-MM-dd"/>
                        </g:if>
                        <td><g:formatDate date="${this.riskWarning?.startTime}" format="yyyy-MM-dd"/></td>
                        <td><g:formatDate date="${this.riskWarning?.endTime}" format="yyyy-MM-dd"/></td>
                        <td><g:formatDate date="${this.riskWarning?.actualStartTime}" format="yyyy-MM-dd"/></td>
                        <td><g:formatDate date="${this.riskWarning?.actualEndTime}" format="yyyy-MM-dd"/></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    %{--贷款信息--}%
    <div class="row">
        <div class="hpanel hgreen" style="">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                贷款信息
            </div>

            <div class="panel-body no-padding" style="overflow-x:auto;">
                <table class="table table-striped table-bordered table-hover text-center">
                    <thead>
                    <tr>
                        <th>贷款编号</th>
                        <th>贷款余额</th>
                        <th>贷款总额</th>
                        <th>成交总价</th>
                        <th>回收总本金</th>
                        <th>回收总利息</th>
                        <th>回收总罚息</th>
                        <th>贷款状态</th>
                        <th>违约期数</th>
                        <th>逾期期数</th>
                        <th>担保机构</th>
                        <th>放款银行</th>
                        <th>抵押类型</th>
                        <th>贷款方式</th>
                        <th>是否不良</th>
                        <th>贷款时评估总价</th>
                        <th>贷款时评估单价</th>
                        <th>贷款到期日</th>
                        <th>贷款放款日</th>
                        <th>已还期数</th>
                        <th>剩余还款总期数</th>
                        <th>还款方式</th>
                        <th>月还款金额</th>
                    </tr>
                    </thead>
                    <tbody>
                    <g:each in="${com.cindata.Mortgage.findAllByMortgageContact(contact)}">
                        <tr>
                            <td><g:link class="firstTd" style="color: #3498DB" action="show" controller="mortgage" id="${it?.id}">${it?.serialNumber?it?.serialNumber:'-'}</g:link></td>
                            <td>${it?.loansBalance?it?.loansBalance:'-'}元</td>
                            <td>${it?.loansAmount?it?.loansAmount:'-'}元</td>
                            <td>
                                <g:if test="${it?.loansEvaluateTotalPrice}">
                                    ${com.cindata.NumberUtil.GetFixedNumber(it?.loansEvaluateTotalPrice/10000)}（万元
                                </g:if>
                                <g:else>
                                    -
                                </g:else>
                            </td>
                            <td>${it?.curRecycleTotalCapital?it?.curRecycleTotalCapital:'-'}元</td>
                            <td>${it?.curRecycleTotalInterest?it?.curRecycleTotalInterest:'-'}元</td>
                            <td>${it?.curRecycleTotalFine?it?.curRecycleTotalFine:'-'}元</td>
                            <td>${it?.mortgageStatus?it?.mortgageStatus?.name:'-'}</td>
                            <td style="color: red;font-size: 18px">5</td>
                            <td>${it?.curOverdueDuration?it?.curOverdueDuration:'-'}</td>
                            <td>${it?.guaranteeInstitution?it?.guaranteeInstitution.name:'-'}</td>
                            <td>${it?.loansBankName?it?.loansBankName:'-'}</td>
                            <td>${it?.mortgageType?it?.mortgageType?.name:'-'}</td>
                            <td>${it?.mortgagePattern?it?.mortgagePattern?.name:'-'}</td>
                            <td>${it?.isNonPerformingLoan?'不良':'良'}</td>
                            <td>${it?.loansEvaluateTotalPrice?it?.loansEvaluateTotalPrice:'-'}元</td>
                            <td>${it?.loansEvaluatePrice?it?.loansEvaluatePrice:'-'}元</td>
                            <td>
                                <g:if test="${it?.endDate}">
                                    <g:formatDate date="${it?.endDate}" format="yyyy-MM-dd"></g:formatDate>
                                </g:if>
                                <g:else>
                                    -
                                </g:else>
                            </td>
                            <td>
                                <g:if test="${it?.startDate}">
                                    <g:formatDate date="${it?.startDate}" format="yyyy-MM-dd"></g:formatDate>
                                </g:if>
                                <g:else>
                                    -
                                </g:else>
                            </td>
                            <td>${it?.curHasPaymentTODuration?it?.curHasPaymentTODuration:'-'}月</td>
                            <td>${it?.remainTime?it?.remainTime:'-'}月</td>
                            <td>${it?.curRepaymentMode?it?.curRepaymentMode?.name:'-'}</td>
                            <td>${it?.monthlyRepaymentAmount?it?.monthlyRepaymentAmount:'-'}元</td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    %{--借款人信息--}%
    <div class="row">
        <div class="hpanel hgreen" style="">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                借款人信息
            </div>
            <div class="panel-body no-padding" style="overflow-x:auto;">
                <table class="table table-striped table-bordered table-hover text-center">
                    <thead>
                    <tr>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>年龄</th>
                        <th>证件类型</th>
                        <th>证件号码</th>
                        <th>联系方式</th>
                        <th>借记卡号</th>
                        <th>出生年月日</th>
                        <th>户口所在地</th>
                        <th>户口性质</th>
                        <th>工作单位</th>
                        <th>工作单位性质</th>
                        <th>职称</th>
                        <th>职务</th>
                        <th>学历</th>
                        <th>婚姻状况</th>
                        <th>家庭月收入</th>
                        <th>信用等级</th>
                        <th>信用额度</th>
                        <th>信用余额</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>${contact?.fullName}</td>
                        <td>${contact?.sex?contact?.sex:'-'}</td>
                        <td><g:if test="${contact?.birthday}">${com.cindata.DateUtilService.getAge(contact.birthday)}</g:if><g:else>-</g:else></td>
                        <td>${contact?.identityType?contact?.identityType.name:'-'}</td>
                        <td>${contact?.idNumber}</td>
                        <td>${contact?.cellphone?contact?.cellphone:'-'}</td>
                        <td>${contact?.debitCardNumber?contact?.debitCardNumber:'-'}</td>
                        <td><g:if test="${contact?.birthday}"><g:formatDate date="${contact?.birthday}" format="yyyy-MM-dd"></g:formatDate></g:if><g:else>-</g:else></td>
                        <td>${contact?.householdAddress?contact?.householdAddress:'-'}</td>
                        <td>${contact?.householdType?contact?.householdType:'-'}</td>
                        <td>${contact?.workUnitName?contact?.workUnitName:'-'}</td>
                        <td>${contact?.workUnitNature?contact?.workUnitNature.name:'-'}</td>
                        <td>${contact?.title?contact?.title:'-'}</td>
                        <td>${contact?.position?contact?.position:'-'}</td>
                        <td>${contact?.degree?contact?.degree:'-'}</td>
                        <td>${contact?.maritalStatus?contact?.maritalStatus:'-'}</td>
                        <td>${contact?.fmiOnLoans?contact?.fmiOnLoans:'-'}元</td>
                        <td>${contact?.creditLevel?contact?.creditLevel:'-'}</td>
                        <td>${contact?.creditAmount?contact?.creditAmount:'-'}</td>
                        <td>${contact?.creditBalance?contact?.creditBalance:'-'}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    
    <div class="row">
        <div class="hpanel hgreen collapsed">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                附件信息
            </div>

            <div class="panel-body no-padding">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="horange">
                            <div class="panel-body float-e-margins" style="border-top: none;">
                                <g:each in="${com.cindata.dictionary.AttachmentType.list()}">
                                    <g:link target=" _blank" class="btn btn-outline btn-primary" controller="attachment" action="riskWarningShow" id="${this.riskWarning.id}"
                                            params="[attachmentTypeName: it?.name]">${it?.name}</g:link>
                                </g:each>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    %{--工作流--}%
    <div class="row">
        <div class="hpanel hgreen collapsed">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                工作流
            </div>
            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn width="5%" property="executionSequence"
                                              title="${message(code: 'riskWarningFlowStage.executionSequence.label', default: '次序')}"/>
                            <g:sortableColumn width="10%" property="stage"
                                              title="${message(code: 'riskWarningFlowStage.stage.label', default: '订单阶段')}"/>
                            <g:sortableColumn width="5%" property="canReject"
                                              title="${message(code: 'riskWarningFlowStage.canReject.label', default: '能否回退')}"/>
                            <g:sortableColumn width="10%" property="startTime"
                                              title="${message(code: 'riskWarningFlowStage.startTime.label', default: '开始时间')}"/>
                            <g:sortableColumn width="10%" property="endTime"
                                              title="${message(code: 'riskWarningFlowStage.endTime.label', default: '结束时间')}"/>
                            <g:sortableColumn width="45%" property="comments"
                                              title="${message(code: 'riskWarningFlowStage.comments.label', default: '备注')}"/>
                            <g:sortableColumn width="7%" property="layout"
                                              title="${message(code: 'riskWarningFlowStage.layout.label', default: '布局')}"/>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${com.cindata.RiskWarningFlowStage.findAllByRiskWarning(this?.riskWarning, [sort: 'executionSequence', order: 'asc'])}">
                            <tr>
                                <td width="5%">
                                    <g:link controller="riskWarningFlowStage" action="show" id="${it.id}">${it?.executionSequence}</g:link>
                                </td>
                                <td width="10%">${it?.stage?.name}</td>
                                <td width="5%">${it?.canReject}</td>
                                <td width="10%">
                                    <g:formatDate class="weui_input" date="${it?.startTime}" format="yyyy-MM-dd HH:mm:ss" name="startTime" autocomplete="off" readonly="true"></g:formatDate>
                                </td>
                                <td width="10%">
                                    <g:formatDate class="weui_input" date="${it?.endTime}" format="yyyy-MM-dd HH:mm:ss" name="endTime" autocomplete="off" readonly="true"></g:formatDate>
                                </td>
                                <td width="45%"> <p class="text-comment">${it?.comments}</p></td>
                                <td width="5%">
                                    <p class="text-comment">${it?.layout?.description}</p>
                                </td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    %{--催收信息--}%
    <div class="row">
        <div class="hpanel hgreen collapsed" style="">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                催收处置信息
            </div>
            <div class="panel-body no-padding" style="overflow-x:scroll;">
                <table class="table table-striped table-bordered table-hover text-center">
                    <thead>
                    <tr>
                        <th>催收类型</th>
                        <th>催收时间</th>
                        <th>催收部门</th>
                        <th>委外机构</th>
                        <th>催收负责人</th>
                        <th>客户约定还款计划</th>
                        <th>逾期还款后果提示</th>
                        <th>逾期原因</th>
                        <th>催收结果</th>
                    </tr>
                    </thead>
                    <tbody>
                    <g:each in="${com.cindata.MortgageCollectionRecord.findAllByMortgage(mortgage)?.sort{a, b -> a.modifiedDate > b.modifiedDate ? -1 : 1 }}">
                        <tr>
                        <td><g:link style="color: #3498DB" class="firstTd" id="${it?.id}" params="[riskWarning: riskWarning?.id]" controller="mortgageCollectionRecord" action="show">${it?.collectionType?.name}</g:link></td>
                            <td>${it?.createdDate}</td>
                            <td>${it?.department}</td>
                            <td>${it?.agencyAccount?.name}</td>
                            <td>${it?.fullName}</td>
                            <td>${it?.repaymentPlan}</td>
                            <td>${it?.isRemindedConsequence?'已提示':'未提示'}</td>
                            <td>${it?.reasonOfOverdue}</td>
                            <td>${it?.collectionResult}</td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    %{--诉讼信息--}%
    <div class="row">
        <div class="hpanel hgreen collapsed" style="">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                诉讼处置信息
            </div>
            <div class="panel-body no-padding" style="overflow-x:scroll;">
                <table class="table table-striped table-bordered table-hover text-center">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>代偿金额</th>
                        <th>代偿时间</th>
                        <th>案号</th>
                        <th>申诉人</th>
                        <th>立案时间</th>
                        <th>开庭时间</th>
                        <th>法院</th>
                        <th>审判时间</th>
                        <th>审判结果</th>
                        <th>上诉人</th>
                        <th>被上诉人</th>
                        <th>上诉日期</th>
                        <th>执行案号</th>
                        <th>执行结果</th>
                        <th>起拍价格</th>
                        <th>竞拍结果</th>
                        <th>拍卖处置</th>
                    </tr>
                    </thead>
                    <tbody>
                    <g:each in="${com.cindata.MortgageLitigationRecord.findAllByMortgageAndRiskWarning(mortgage,riskWarning)}">
                        <tr>
                            <td><g:link style="color: #3498DB" class="firstTd" id="${it?.id}" controller="mortgageLitigationRecord" action="litigation">${it?.id}</g:link></td>
                            <td>${it?.compensatoryMoney}</td>
                            <td><g:formatDate date="${it?.compensatoryDate}" format="yyyy-MM-dd" ></g:formatDate></td>
                            <td>${it?.caseNumber}</td>
                            <td>${it?.appeals}</td>
                            <td><g:formatDate date="${it?.filingDate}" format="yyyy-MM-dd" ></g:formatDate></td>
                            <td><g:formatDate date="${it?.courtDate}" format="yyyy-MM-dd" ></g:formatDate></td>
                            <td>${it?.court}</td>
                            <td><g:formatDate date="${it?.judgmentDate}" format="yyyy-MM-dd" ></g:formatDate></td>
                            <td>${it?.judgmentResult}</td>
                            <td>${it?.appellant}</td>
                            <td>${it?.appellee}</td>
                            <td><g:formatDate date="${it?.appealDate}" format="yyyy-MM-dd" ></g:formatDate></td>
                            <td>${it?.executeCaseNumber}</td>
                            <td>${it?.executeResult}</td>
                            <td>${it?.startPrice}</td>
                            <td>${it?.auctionResult}</td>
                            <td>${it?.auctionDisposal}</td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading hbuilt">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                审批意见
            </div>
            <div class="panel-body p-xs">
                <div class="col-md-6">
                    <div class="hpanel">
                        <div class="v-timeline vertical-container animate-panel">
                            <g:each in="${com.cindata.Comment.findAllByRiskWarning(this.riskWarning)}">
                                <div class="vertical-timeline-block">
                                    <div class="vertical-timeline-icon navy-bg">
                                        <i class="fa fa-calendar"></i>
                                    </div>
                                    <div class="vertical-timeline-content">
                                        <div class="p-sm">
                                            <span class="vertical-date pull-right">${it?.user?.fullName}</span>
                                            <h5>${it?.warningStage?.name}<span class="m-l-xs"><g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${it?.createdDate}"></g:formatDate></span></h5>
                                            <p>${it?.comment}</p>
                                        </div>
                                    </div>
                                </div>
                            </g:each>
                        </div>
                    </div>
                </div>

                <div class="col-md-6">
                    <g:form controller="comment" action="save">
                        <div class="hpanel">
                            <div class="panel-heading">
                                <div class="panel-tools">
                                    <g:if test="${approveRoleFlag}">
                                        <button class="btn btn-xs btn-info pull-right"><i class="fa fa-plus"></i> 保存</button>
                                    </g:if>
                                </div>
                                您的审批意见
                            </div>
                            <g:textArea name="comment" id="comment1" class="form-control" rows="4"/>
                            <input type="hidden" name="riskWarning.id" value="${this?.riskWarning?.id}">
                            <input type="hidden" name="warningStage.id" value="${this?.riskWarning?.stage?.id}">
                        </div>
                    </g:form>
                </div>
            </div>
        </div>
    </div>
</div>

<footer class="footer bg-success" style="left: 0;bottom: 41px; padding: 5px 50px 2px 18px;">
    <div class="row">
        <div class="text-right">
            <g:if test="${approveRoleFlag}">
                <button class="btn btn-sm btn-info" data-toggle="modal" data-target="#riskWarningReject"><i class="fa fa-arrow-up"></i> 上一步</button>
                <g:form action="approve" style="display: inline-block" id="${this.riskWarning?.id}">
                    <input type="hidden" name="targetUri" value="${params['targetUri']}">
                    <button class="btn btn-sm btn-info confirmBtn" type="button"><i class="fa fa-arrow-down"></i>下一步</button>
                </g:form>
            </g:if>
        </div>
    </div>
</footer>

<div class="modal fade" id="riskWarningReject" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <g:form class="form-horizontal rejectform" controller="riskWarning" action="reject">
                <input type="hidden" name="riskWarning.id" value="${this.riskWarning?.id}">
                <input type="hidden" name="targetUri" value="${params['targetUri']}">
                <div class="color-line"></div>

                <div class="modal-header">
                    <h4 class="modal-title">返回原因</h4>
                </div>

                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">返回原因</label>
                        <div class="col-sm-10">
                            <g:textArea class="form-control" id="comment" name="comment" value="" rows="6"/>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary riskWarningRejectBtn">保存</button>
                </div>
            </g:form>
        </div>
    </div>
</div>

<script>

        // 确认拒绝
        $(document).delegate(".riskWarningRejectBtn", "click",
            function() {
                var comment = $("#comment").val();
                if (!comment) 
                {
                    toastr.error('请填写返回原因！');
                    return
                }
                swal({
                    title: "是否确认提交吗?",
                    type: "warning",
                    showCancelButton: true,
                    confirmButtonColor: "#3aa9dd",
                    cancelButtonText: "取消",
                    confirmButtonText: "确认",
                    closeOnConfirm: false,
                    closeOnCancel: true
                },
                function(isConfirm) {
                    if (isConfirm) {
                        $(".rejectform").submit();
                        swal("提交成功！", "", "success");
                    }
                });
            });

    $(function () {

        $(".btnRiskWaring").click(function () {
            var contactRiskWarningDispositionId = $(this).attr("dataId").trim();
            $(".contactRiskWarningDispositionId").val(contactRiskWarningDispositionId);

        });

        $('#datepicker').datepicker({
            language: 'zh-CN'
        });
        $("#datepicker").on("changeDate", function (event) {
            $("#my_hidden_input").val(
                $("#datepicker").datepicker('getFormattedDate')
            )
        });

        $('.input-group.date').datepicker({});
        $('.input-daterange').datepicker({});
    });

    //    $('#goBack').click(function(){
    //        window.history.back(-1);
    //    })
    var riskText=$('.risk').text();
    if(riskText=='低风险>>'){
        $('.risk').css('color','#62CB31');
    }else if(riskText=='中风险>>'){
        $('.risk').css('color','#FF9800');
    }
    else if(riskText=='高风险>>'){
        $('.risk').css('color','#E51C23');
    }else{
        $('.risk').css('color','#3498DB');
    }


</script>
<script>
    function show(id){
        var url = window.location.origin+"/mortgage/show?id="+id;
        window.open(url);
    }

</script>
</body>
</html>
